#include "..\..\StdAfx.h"
#include "QuenchThirst.h"


QuenchThirst::~QuenchThirst(void)
{
}

bool QuenchThirst::Enter(Miner* pEntity, float fTime)
{
	_TRACE(_T("Enter QuenchThirst.\n"));

	if (pEntity->Location() != Bar)
		pEntity->SetDestination(Bar);

	m_fStateEnterTime = fTime;
	return true;
}

bool QuenchThirst::Execute(Miner* pEntity, float fTime)
{
	if (pEntity->Location() != Bar)
		return pEntity->Walking(fTime);

	if (pEntity->Drink(fTime))
		return pEntity->GetFSM()->RevertToPreviousState(fTime);

	return false;
}

bool QuenchThirst::Exit(Miner* pEntity, float fTime)
{
	return true;
}